#include "stdafx.h"
#include "Driver.h"
#include "NoviceDriver.h"
#include "ExperiencedDriver.h"
#include "DriveBehavior.h"
#include "NotDrive.h"
#include "DrivePassengerCar.h"
#include "DriveTruck.h"

void RetrainingDrivers(std::auto_ptr<Driver> firstDriver, std::auto_ptr<Driver> secondDriver)
{
    firstDriver->Drive();
    secondDriver->Drive();

    std::cout << "Retraining drivers" << std::endl;

    std::shared_ptr<DriveBehavior> drivePassengerCar(new DrivePassengerCar());
    std::shared_ptr<DriveBehavior> driveTruck(new DriveTruck());

    firstDriver->SetDriveBehavior(drivePassengerCar);
    secondDriver->SetDriveBehavior(driveTruck);

    firstDriver->Drive();
    secondDriver->Drive();
}

int main(int argc, char * argv[])
{
    std::auto_ptr<Driver> noviceDriver(new NoviceDriver());
    std::auto_ptr<Driver> experiencedDriver(new ExperiencedDriver());

    RetrainingDrivers(noviceDriver, experiencedDriver);

	return 0;
}

